Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

logdna-winston

Package Overview
Dependencies
Maintainers
3
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

logdna-winston

LogDNA's Node.js logging module with support for Winston

  • 2.3.2
  • Source
  • npm
  • Socket score

Version published
Maintainers
3
Created
Source

Node.js Winston library for logging to LogDNA


Install

$ npm install --save logdna-winston

API

Please see the logdna npm module for the API.

Winston Transport

This module also provides a transport object, which can be added to winston using:

const logdnaWinston = require('logdna-winston');
const winston = require('winston');
const logger = winston.createLogger({});
const options = {
    key: apikey,
    hostname: myHostname,
    ip: ipAddress,
    mac: macAddress,
    app: appName,
    env: envName,
    level: level, // Default to debug, maximum level of log, doc: https://github.com/winstonjs/winston#logging-levels
    index_meta: true // Defaults to false, when true ensures meta object will be searchable
};

// Only add this line in order to track exceptions
options.handleExceptions = true;

logger.add(new logdnaWinston(options));


// log with meta
logger.log({
    level: 'info'
    , message: 'Log from LogDNA-winston'
    , index_meta: true // Ignore this if you would like to use default setting
    , data:'Some information' //  Properties besides level, message and index_meta are considered as "meta"
    , error: new Error("It's a trap.") // Transport will parse the error object under property 'error'
});

// log without meta
logger.info('Info: Log from LogDNA-winston');

License

MIT © LogDNA

Happy Logging!

Keywords

FAQs

Package last updated on 25 Jun 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc